﻿using System;
using System.Threading.Tasks;

namespace Loong.BackgroundJobs
{
    public interface IBackgroundJobManager
    {
        Task<string> EnqueueAsync<TJob, TArgs>(TArgs args, string cron = null, DateTime? endTryTime = null, TimeSpan? delay = null, BackgroundJobPriority priority = BackgroundJobPriority.Normal)
            where TJob : IBackgroundJob<TArgs>;

        Task<bool> DeleteAsync(string jobId);
    }
}
